package com.xintonghua.bussiness.adapter;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.xintonghua.base.adapter.BaseAdapter;
import com.xintonghua.bussiness.R;
import com.xintonghua.bussiness.bean.HistoryRecordBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by liqi on 2018/4/9.
 */

public class MeiRongTestHistoryRecordAdapter extends BaseAdapter<HistoryRecordBean, MeiRongTestHistoryRecordAdapter.GoodViewHolder> {
    private boolean check = false;

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    public MeiRongTestHistoryRecordAdapter(Activity mActivity, List<HistoryRecordBean> list) {
        super(mActivity, list);
    }


    @Override
    public GoodViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.adapter_item_meirongtest_history_record, parent, false);
        return new GoodViewHolder(view);
    }

    @Override
    public void onBindViewHolder(GoodViewHolder holder, int position) {
        final HistoryRecordBean bean = list.get(position);

        holder.tvNumbers.setText(""+bean.getScore());
        holder.tvType.setText(""+bean.getName());
    }


    class GoodViewHolder extends RecyclerView.ViewHolder {

        @BindView(R.id.tv_type)
        TextView tvType;
        @BindView(R.id.tv_numbers)
        TextView tvNumbers;
        @BindView(R.id.fl_content)
        FrameLayout flContent;
        public GoodViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
